---
apiVersion: rbac.authorization.k8s.io/v1
kind: ClusterRole
metadata:
  name: d8:monitoring-kubernetes-control-plane:scraper
  {{- include "helm_lib_module_labels" (list .) | nindent 2 }}
rules:
- nonResourceURLs:
  - /metrics
  - /scheduler/metrics
  - /controller-manager/metrics
  - /etcd/metrics
  verbs:
  - get
---
apiVersion: rbac.authorization.k8s.io/v1
kind: ClusterRoleBinding
metadata:
  name: d8:monitoring-kubernetes-control-plane:scraper
  {{- include "helm_lib_module_labels" (list .) | nindent 2 }}
roleRef:
  apiGroup: rbac.authorization.k8s.io
  kind: ClusterRole
  name: d8:monitoring-kubernetes-control-plane:scraper
subjects:
- apiGroup: rbac.authorization.k8s.io
  kind: User
  name: d8-monitoring:scraper
- kind: ServiceAccount
  name: prometheus
  namespace: d8-monitoring
